Skip to content

Release proximity wakelock on Element Call when call ends#6825

Merged
jmartinesp merged 1 commit into
developfrom
fix/release-call-wakelock-on-call-ended
May 20, 2026
Merged

Release proximity wakelock on Element Call when call ends#6825
jmartinesp merged 1 commit into
developfrom
fix/release-call-wakelock-on-call-ended

Conversation

@jmartinesp
Copy link
Copy Markdown
Member

Content

The CoroutineScope that launched this logic was cancelled by that point, so the wakelock was never released. Since the call already ended it should be OK to skip the mutex and ensure the wakelock is released in the main thread.

Motivation and context

Replacement of #6752.

Fixes #6815.

Tests

  • In a DM, start a voice call.
  • Don't answer it and let it automatically end with a timeout.
  • Check the proximity sensor is no longer active, dimming the screen brightness when you place your device next to your ear.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 15

Checklist

  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

The `CoroutineScope` that launched this logic was cancelled by that point, so the wakelock was never released.
@jmartinesp jmartinesp requested a review from a team as a code owner May 20, 2026 11:58
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label May 20, 2026
@jmartinesp jmartinesp requested review from ganfra and removed request for a team May 20, 2026 11:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.27%. Comparing base (42c1411) to head (6371281).

Files with missing lines Patch % Lines
...id/features/call/impl/utils/WebViewAudioManager.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6825   +/-   ##
========================================
  Coverage    81.26%   81.27%           
========================================
  Files         2648     2648           
  Lines        74170    74168    -2     
  Branches      9622     9622           
========================================
  Hits         60277    60277           
+ Misses       10341    10339    -2     
  Partials      3552     3552           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/bkcrQs

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmartinesp jmartinesp merged commit 42566b4 into develop May 20, 2026
37 of 38 checks passed
@jmartinesp jmartinesp deleted the fix/release-call-wakelock-on-call-ended branch May 20, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wakelock is still held after the call timeouts and Element Call closes

2 participants